import os, json, tqdm

def get_category(DATA_PATH):
    
    category_list = []
    
    for clip in tqdm.tqdm(os.listdir(DATA_PATH), desc='Getting category...'):
        RAW_JSON_PATH = os.path.join(DATA_PATH, clip, 'data/Label/RAW')
        for file in os.listdir(RAW_JSON_PATH):
            with open(os.path.join(RAW_JSON_PATH, file), 'r') as f:
                data = json.load(f)
                for anno in data:
                    if "object_type" in anno.keys():
                        category_list.append(anno["object_type"])
                        
    return list(set(category_list))    